package nz.ac.massey.doi_information_extractor.tests;

import static org.junit.Assert.*;

import java.io.IOException;

import org.junit.Before;
import org.junit.Test;

import nz.ac.massey.doi_information_extractor.data.Publication;
import nz.ac.massey.doi_information_extractor.parser.PublicationNotFoundException;
import nz.ac.massey.doi_information_extractor.parser.SCOPUSPlugin;


public class SCOPUSPluginTest {
	
	Publication testpub;
	
	@Before
	public void setUp() throws Exception{
		System.setProperty("http.proxyHost", "tur-cache.massey.ac.nz");
		System.setProperty("http.proxyPort", "8080");
		
		SCOPUSPlugin plugin = new SCOPUSPlugin("10.1007/s11416-008-0104-2");
		try {
			testpub = plugin.call();
		} catch (PublicationNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	
	@Test 
	public void test() {
		assertTrue(testpub.getArticleTitle().equals("New data mining technique to enhance IDS alarms quality"));
		
		assertTrue(testpub.getPublicationTitle().equals("Journal in Computer Virology"));
	}
}
